<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import="java.sql.*" %>

<%
ResultSet rs;
String row = null;
String row2 = null;
String result;

String driverName="com.mysql.jdbc.Driver";
Class.forName("com.mysql.jdbc.Driver").newInstance();

String url="jdbc:mysql://127.0.0.1/exe";
String user="root";
String password="admin";

int userid = Integer.parseInt(request.getParameter("userid"));
String page1=request.getParameter("page1");
String page2=request.getParameter("page2");

   Connection conn=DriverManager.getConnection(url,user,password);
   Statement stmt=conn.createStatement();
   String SQLI="select * from comments where id="+userid;
   rs=stmt.executeQuery(SQLI);
   if(rs.next()) 
   { 
   	row = rs.getString(2); 
    row2 = rs.getString(3);
   } 
   
   
   stmt.close();

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<br><p3>Result</p3>
</head>
<body>
The searching result is:<br>
<% if(row==null) {result="not exits number";
                row=" ";row2=" ";
}else{
	result=String.valueOf(userid);
}

%>
ID:<%=result %>  selected <br>
<%=row %><br>
<%=row2 %><br>

<input type="button" value="Back" onclick="window.location.href='index.jsp'">


</body>
</html>